package com.margo.project.tomcat.connector;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/tomcat/connector")
public class ConnectorController {

	private Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@RequestMapping("/timeout")
	@ResponseBody
	public String timeout() {
		Long begin=System.currentTimeMillis();
		logger.info("接收请求");
		try {
			Thread.sleep(30000);
		} catch (InterruptedException e) {
			logger.info("线程异常中断",e);
		}
		long cost=System.currentTimeMillis()-begin;
		logger.info("请求耗时："+cost);
		return "OK";
	}
}
